﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ClassDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            
            int salarySum = 0;
            Employee[] employees = new Employee[5];
            for (int i =0; i<5; i++)
            {
                Console.Clear();
                Employee newEmployee = new Employee();
                Console.WriteLine("Empoyee {0} - Enter name :", (i+1));
                newEmployee.employeeFirstName = Console.ReadLine();
                Console.WriteLine("Empoyee {0} - Enter last name:", (i + 1));
                newEmployee.employeeLastName = Console.ReadLine();
                Console.WriteLine("Empoyee {0} - Enter salary ($):", (i + 1));
                newEmployee.salary = Int32.Parse(Console.ReadLine());
                salarySum = salarySum + newEmployee.salary;
                employees[i] = newEmployee;
                
            }
            foreach (var item in employees)
            {
                item.PrintInfo();
            }
            Console.WriteLine("Salary sum ($) is: {0}", salarySum);
        }
    }
    class Employee
    {
        public string employeeFirstName;
        public string employeeLastName;
        public int salary;

        public void PrintInfo()
        {
            Console.WriteLine("Employee  {0} {1}", employeeFirstName, employeeLastName);
        }
    }
}
